<#include "../common/layout.ftl"/>
<@layout>
<div width="100%" style="height: 900px;">
	<div class="dxfsqd_title">算费规则管理</div>
	<div class="dxfsqd_shearch">
	<form method="post" action="/pricerule" class="form-inline">
		<#if session.userRole == 'admin' || session.userRole == 'brandManager'>			
			<button type="submit" class="btn"><i class="icon-search icon-white"></i>查询</button>
		</#if>
		<#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
			<button class="btn" href="/pricerule/add"><i class="icon-user icon-white"></i>添加规则</button>
		</#if>
	</form>
  </div>

<div class="dxfsqd_table">

	<table class="table table-bordered table-striped">
		<thead>
		  <tr>
			<th scope="col">ID</th>
			<th scope="col">规则名称</th>
			<th scope="col">分公司代码</th>
			<th scope="col">是否默认规则</th>
			<th scope="col">操作</th>
		  </tr>
		</thead>
		<tbody>
		<#list ruleList as rule>
		  <tr>
			<td>
			  <span class="label">${rule.id}</span>
			</td>
			<td>
			  ${rule.name}
			</td>
			<td>
			  ${rule.company}
			</td>
			<td>
			   <#if rule.is_default??>
			   		<#if rule.is_default == 1>
			   			默认
			   		<#else>
			   			否
			   		</#if>
			   <#else>
			      	否
			   </#if>
			</td>
			<td>
				<div class="btn-group">
					 <a class="cf" href="/pricerule/edit/${rule.id}"><i class="icon-info-sign icon-white"></i> 修 改</a>
					 <a class="cf" href="/pricerule/setdefault/${rule.id}"><i class="icon-info-sign icon-white"></i> 设置为默认</a>
					 <#if session.userId == 1>
					 <a class="cf" href="/pricerule/delete/${rule.id}"><i class="icon-trash icon-white"></i> 删 除</a>
					 </#if>
				</div>
			</td>
		  </tr>
		</#list>
		</tbody>
	</table>  
</div>
</div>
          
</@layout>